import re
import matplotlib.pyplot as plt

# 从文件中读取文本
with open('profile.txt', 'r') as file:
    data = file.read()

print(data)
ilut_data = re.findall(r'ilut =+[\s\S]+?none', data)[0]
none_data = re.findall(r'none =+[\s\S]+', data)[0]

ilut_times = [float(x.split(':')[-1]) for x in ilut_data.split('\n') if x.strip()]
none_times = [float(x.split(':')[-1]) for x in none_data.split('\n') if x.strip()]

plt.plot(ilut_times, label='ilut')
plt.plot(none_times, label='none')
plt.xlabel('Case')
plt.ylabel('Total Program Time')
plt.legend()
plt.show()

